function [ta,fs,ga,prf,ss] = lerXmlPXI(pathConfig,filenameConfig)

%[filenameConfig,pathConfig] = uigetfile(['' path '*.xml; *.txt'],'Selecione o arquivo de configuracao'); 
mystruct=xml2struct(strcat(pathConfig, filenameConfig));
myvalues{1, 1}='Start';
[lastfield allfields, lastname]=nextlevel(mystruct, myvalues, {' '});
clear lastfield
clear lastname
allfields{2, size(allfields, 2)}=[];

for i=1:size(allfields, 2)
   if strcmp(allfields{2, i}, 'Val')==1
          value=str2num(allfields{1, i});
          if isempty(value)
          value=allfields{1, i};
          end
          a={strfind( allfields{1, i-1}, 'of records'), 'pulsos';
             strfind( allfields{1, i-1}, 'sample rate'), 'fs';
             strfind( allfields{1, i-1}, 'ganho'), 'ga';
             strfind( allfields{1, i-1}, 'frq pulsos'), 'prf'; 
             strfind( allfields{1, i-1}, 'record length'), 'ss'};
         for pos=1:size(a, 1)
             if isempty(a{pos, 1})==0
                 allvalues.(a{pos, 2})=value;
             end
         end
                 
   end
end
ta= allvalues.pulsos/ allvalues.prf;
fs= allvalues.fs;
ga= allvalues.ga;
prf= allvalues.prf;
ss= allvalues.ss;